Skip to content

feat: run on MCP Python SDK 2.x - #8

Merged
quazardous merged 2 commits into
mainfrom
claude/keen-volta-zj7oz6
Oct 18, 2026
Merged

quazardous merged 2 commits into
mainfrom
claude/keen-volta-zj7oz6

Conversation

@quazardous

Copy link
Copy Markdown
Owner

Moves wbox-mcp to the MCP Python SDK 2.x API and drops 1.x support.

Changes

  • src/wbox/server.py: SDK 2.x removed the @Server.list_tools() / @Server.call_tool() decorators. create_server now passes on_list_tools / on_call_tool to the Server constructor. The tool bodies are unchanged.
  • The 1.x decorator validated arguments against each tool's inputSchema and turned an exception into an isError result. 2.x leaves both to the handler, so on_call_tool does them with the same messages. jsonschema is now a direct dependency.
  • tests/mcp-dev/server.py: the same port for the dev wrapper.
  • pyproject.toml: mcp>=2.3,<3. uv.lock regenerated (mcp 2.3.0).
  • CHANGELOG entry.

Verification

  • Over stdio, against wbox-mcp serve with the crash-dummy config, I ran a 2.3 client and a 1.26 client. Both get the same results as main running mcp 1.26: initialize, 26 tools listed, an unknown tool, a schema-invalid call (isError + "Input validation error: 'command' is a required property"), and click with no compositor.
  • The tests/mcp-dev/server.py handshake works: 19 tools, status and stop respond.
  • pytest tests gives the same counts on this branch and on main (5 failed / 38 passed / 68 skipped / 490 errors). This container has no display, tkinter or labwc, so the compositor tests could not run. The integration workflow covers them.

Fixes #7


Generated by Claude Code

SDK 2.x replaced the Server.list_tools()/call_tool() decorators with
on_list_tools/on_call_tool handlers passed to the constructor, which take
a request context and return ListToolsResult/CallToolResult. The tool
bodies are unchanged; create_server now wires them through those handlers.

The 1.x decorator also validated arguments against the tool's input schema
and turned a raising tool into an error result. 2.x leaves both to the
handler, so on_call_tool keeps them, with the same messages. jsonschema is
now a direct dependency.

Requires mcp>=2.3,<3. Checked over stdio with both a 2.3 and a 1.26
client: same tool list, results, validation errors and error results as
main on 1.26.

Fixes #7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y1K5ZxarAhddzS87B9bG7h
@quazardous
quazardous merged commit c3e336f into main Oct 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support MCP Python SDK 2.x

2 participants